package com.chj.comp.common.gateway.filter;


import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

/**
 * @Description: 自定义全局过滤器
 * @Author: cuihui
 * @Date: 2023/02/22
 */
@Component
@Slf4j
public class CustomGlobalFilter2 implements GlobalFilter, Ordered {


    @Override
    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
        log.info("-----自定义全局过滤器（2）-----");
        return chain.filter(exchange);
    }

    @Override
    public int getOrder() {
        return 0;
    }
}